<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.sport.po.User" %>

<%@page import="com.sport.po.Manager" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //Custom Theme files -->
<link href="<%=path %>/css/bootstrap.css" type="text/css" rel="stylesheet" media="all">
<link href="<%=path %>/css/style.css" type="text/css" rel="stylesheet" media="all">
<!-- js -->
<script src="<%=path %>/js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap-3.1.1.min.js"></script>
<!-- //js -->	
<!-- cart -->
<script src="js/simpleCart.min.js"> </script>
</head>
<body>
<%
User user=(User)session.getAttribute("user");
Manager manager =(Manager)session.getAttribute("manager");
%>
<div class="header">
		<div class="container">
			<nav class="navbar navbar-default" role="navigation">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
						<span class="sr-only">Toggle navigation</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<h1 class="navbar-brand"><a  href="home.jsp">Let's 健身</a></h1>
				</div>
				<!--navbar-header-->
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li><a href="<%=path %>/home.jsp" class="active">首页</a></li>
						<li>
							<a href="<%=path %>/course.jsp">课程商城</b></a>
						</li>
							<li>
							<a href="<%=path %>/manager/center1.1.jsp">管理中心</b></a>
						</li>
						<li>
							<a href="#3">论坛</b></a>
						</li>
					</ul> 
					<!--/.navbar-collapse-->
				</div>
				<!--//navbar-header-->
			</nav>
			<div class="header-info">
				<div class="header-right search-box">
					<a href="#"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></a>				
					<div class="search">
						<form class="navbar-form">
							<input type="text" class="form-control">
							<button type="submit" class="btn btn-default" aria-label="Left Align">
								搜索
							</button>
						</form>
					</div>	
				</div>
				<div class="header-right login">
					<a href="<%=path %>/manager/center1.1.jsp"><span class="glyphicon glyphicon-user" aria-hidden="true"></span></a>
					<div id="loginBox">                
						<%
						if(user==null&&manager==null){
							%>
						<form id="loginForm" action="<%=basePath%>LoginAction.action" method="post">
							<fieldset id="body">

								<fieldset>
									<label for="email">用户名</label>
									<input type="text" name="login_name" id="email" onFocus="this.value = '';" onblur="if (this.value == '') {this.value = '请输入用户名';}">
								</fieldset>
								<fieldset>
									<label for="password">密码</label>
									<input type="password" name="password" id="password">
								</fieldset>
								<fieldset>
									<div class="radio">
										<label><input type="radio" name="role" value="user"
											checked="checked" />用户</label>
									</div>
									<div class="radio">
										<label><input type="radio" name="role" value="manager" />管理员</label>
									</div>
								</fieldset>
								<input type="submit" id="login" value="立即登陆">
								<label for="checkbox"><input type="checkbox" id="checkbox"> <i>记住我</i></label>
							</fieldset>
							<p>新用户 ? <a class="sign" href="Register.jsp">注册</a> <span><a href="#">忘记密码?</a></span></p>
						</form>		
						<% }%>
						<% if(user!=null&&manager==null){ %>
							<li class="dropdown" style="margin-right:100px">
									 <a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= user.getUsername()%><strong class="caret"></strong></a>
									<ul class="dropdown-menu">
										<li>
											<a href="#">个人信息</a>
										</li>
										<li>
											 <a href="#">我的课表</a>
										</li>
										<li>
											 <a href="#">我的问答</a>
										</li>
										<li>
											 <a href="#">帐号设置</a>
										</li>
										<li class="divider">
										
										</li>
										<li>
											 <a href="#">退出</a>
										</li>
									</ul>
								</li>
						<%} %>
						<%if(manager!=null&&manager==null){%>
						<li class="dropdown" style="margin-right:100px">
									 <a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= manager.getRealname()%><strong class="caret"></strong></a>
									<ul class="dropdown-menu">
										<li>
											<a href="#">个人信息</a>
										</li>
										<li>
											 <a href="#">我的课表</a>
										</li>
										<li>
											 <a href="#">我的问答</a>
										</li>
										<li>
											 <a href="#">帐号设置</a>
										</li>
										<li class="divider">
										
										</li>
										<li>
											 <a href="#">退出</a>
										</li>
									</ul>
								</li>
						<%} %>
					
					</div>
				</div>
				<div class="header-right cart">
					<a href="#"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span></a>
					<div class="cart-box">
						
						<p><a href="checkout.jsp" class="simpleCart_empty">查看购物车</a></p>
						<div class="clearfix"> </div>
					</div>
				</div>
				<div class="clearfix"> </div>
			</div>
			<div class="clearfix"> </div>
		</div>
	</div>

</body>
</html>